package com.bohua.intermediary.controller;

import com.bohua.intermediary.common.Lay;
import com.bohua.intermediary.common.Msg;
import com.bohua.intermediary.entity.SysNotice;
import com.bohua.intermediary.service.SysNoticeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author qian
 * @email 1415261159@qq.com
 * @date 2019/01/19
 */
@Controller
@RequestMapping("/sysNotice")
public class SysNoticeController {
    @Resource
    private SysNoticeService sysNoticeService;

    @RequestMapping
    public String sysNotice(){
        return "sysNotice/sysNotice";
    }
    @RequestMapping("/add")
    public String add(){
        return "sysNotice/addSysNotice";
    }

    @RequestMapping("/update")
    public String update(){
        return "sysNotice/updateSysNotice";
    }

    @RequestMapping("/getSysNotices")
    @ResponseBody
    public Lay getSysNotices(SysNotice sysNotice,Integer page,Integer limit){
        return sysNoticeService.getSysNotices(sysNotice,page,limit);
    }
    @RequestMapping("/addSysNotice")
    @ResponseBody
    public Msg addSysNotice(SysNotice sysNotice){
        return sysNoticeService.addSysNotice(sysNotice);
    }

    @RequestMapping("/updateSysNotice")
    @ResponseBody
    public Msg updateSysNotice(SysNotice sysNotice){
        return sysNoticeService.updateSysNotice(sysNotice);
    }

    @RequestMapping("/delSysNotice")
    @ResponseBody
    public Msg delSysNotice(SysNotice sysNotice){
        return sysNoticeService.delSysNotice(sysNotice);
    }
}
